<template>
  <popup :show="show" @update:show="$emit('update:show',false)">
    <view :class="['column gap-40',locale]">
      <view class="center head-title">{{ title }}</view>
      <slot></slot>
      <view class="flex-between">
        <view class="width-40">
          <u-button :text="cancelText || otherLang.cancel" style="width: 40rpx" size="large" :plain="true"
                    @click="$emit('update:show')"/>
        </view>
        <view class="width-40">
          <u-button type="primary" size="large" @click="$emit('confirm')" :text="confirmText || otherLang.confirm"/>
        </view>
      </view>
    </view>
  </popup>
</template>

<script>
import Popup from "@/components/popup/popup.vue"

export default {
  name: 'ConfirmPopup',
  components: {Popup},
  props: {
    show: {
      type: Boolean,
      required: true
    },
    title: {
      type: String,
      required: true
    },
    cancelText: {
      type: String,
    },
    confirmText: {
      type: String,
    }
  },
  emits: ['update:show', 'confirm'],
}
</script>